//
//  Camera.h
//  CompGraf2
//
//  Created by Juan Niosi on 16/08/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>

#import "TransformObject.h"
#import "Bounds.h"
#import "Vector3.h"

@class Engine;

@interface Camera : TransformObject
{
    float *planes;
    GLfloat projMatrix[16];
    GLfloat modelMatrix[16];
    GLint *viewportMatrix;
}

- (id)init:(Engine *)engine;
- (void)drawPos:(Engine *)engine;
- (void)reset:(Engine *)engine;

- (GLfloat *)getCameraPlanes;
- (GLfloat *)matrixProduct:(GLfloat *)A:(GLfloat *)B;

- (BOOL)isVisible:(Bounds *)bounds;
- (BOOL)pointInside:(GLfloat)x:(GLfloat)y:(GLfloat)z;

- (Vector3 *)unproject:(CGPoint)point:(GLfloat)winZ;
@end
